Another program I made because all the others like it have some features that are useful, but none have all the features in one app. This is your basic search–all–files–in–a–folder–for–a–string app, except it allows you to store commonly–used directories. It also has a bunch of helpful options. The main reason I wrote File Safari was to have a quick and simple utility for finding function prototypes and #defines in .h files; a program without a bunch of useless memory– and disk–wasting junk like fancy graphics and sounds; a program with one well–defined purpose, not a do–all file locator (System 7.5 already has that).
File Safari supports Balloon Help in all menus and dialogs. If the Balloon Help isn’t enough, read the rest of this file (use TeachText or SimpleText because it contains PICT’s and styled text).
Yes, the main window is a modeless dialog. I don’t care if I’m violating a few HIG’s—it looks cool.
This program was first named “Jonny Quest”, but someone suggested I change it before Hanna–Barbera’s lawyers got ahold of my skinny neck. “File Safari” keeps the adventurous theme, so I didn’t have to ditch the binoculars. :) Why “The Barney Fife Subconscious Prober Primer”? Because “probe” jumped out of the thesaurus while I was trying to come up with a name and I’m a big Andy Griffith Show fan. Any TAGS fan knows what the The Barney Fife Subconscious Prober Primer is (“Gosh darn you Otis!”). Why two names? I dunno. I’m weird.
I assume no responsibility for lost data due to use or misuse of this program, etc, blah blah blah, yatta yatta yatta. If some hunk of legalese is not mentioned here, assume that it has been implied.
Steve Mills
Armpit Studios VII
2219 Davis St.
Iowa City, IA 52240
MuffinHead@netins.net
MuffinHed@aol.com (currently in limbo)
MuffinHead on ISCABBS (bbs.isca.uiowa.edu)
On to the program…
First, the menus…
File menu
• Data Fork Editor []…
This lets you choose a default application to view files whose match was found in the data fork. If you don’t choose a default data fork editor, the application that created the file will be used. The name will be placed into the brackets or it will be [none] if you haven’t chosen one yet.
If for some reason the creator application of a file whose match you double–click can’t accept the Apple® Event to open the file, you will be asked if you would like to open the file with your Data Fork Editor instead.
Power users can use the application they’ve set to be their Data Fork Editor to open any type of file by Option–double–clicking any file in the results list.
• Resource Editor []…
This lets you choose a resource editing application—such as ResEdit or Resorcerer—to use for viewing matches found in a file’s resource fork. The name will be placed into the brackets or it will be [none] if you haven’t chosen one yet.
ΔNote: You can choose either editor from a running process (an application that is already running) by holding down the Option key before clicking in the File menu. Just follow the instructions that appear.
• Use Editors
If this option is on, then your editors will be used to view files. Turn it off to use the file’s actual creator.
• Save Results…
Use this to save the entire search results to a TEXT file. A dialog box will appear so you can set the export options:
◊ Wide Format
This will cause each line of example text shown in the search results to be doubled in length when written to the saved results file.
◊ Offsets & Stuff
This option writes the offset [and resource info] of each match after the example text to the saved results file.
◊ Full Pathnames
Instead of using the truncated file names shown in the search results, the full pathname for each file will be written to the saved results file. E.g. “Hard Drive:A Folder:Another Folder:Found File”.
• Quit
Do I really need to tell you what this does?
Edit menu
• Cut, Copy, & Paste
So you can copy and paste strings in and out of the Search String in the main window.
Options menu
The items in this menu simply mimmic the three buttons of the same names in the main window. It’s here so you can have key equivs for those buttons.
Now the main window…
(On monitors of 640 pixels wide or larger, the window will be 640 wide instead of 512.)
Search String editable text field
Type the string you want to search within files for here.
Search Directory
The starting folder or disk where the search will start. All folders within this folder/disk will also be searched, and folders within those folders, etc…
Note that in addition to the methods listed later, you can drag & drop folders or disks onto the File Safari icon in the Finder to use them as the Search Dir.
The little Search Dir popup menu
If you have added directories to this list, you can choose those to be the Search Dir by simply choosing them from this menu. In the following image, the user has chosen a Search Dir by clicking on the Other… button or by drag & dropping a file onto File Safari’s icon in the Finder and selecting a directory.
By choosing the Add Current Search Dir menu item, the current Search Dir will be added to the end of this menu. If you want to delete one of the entries, hold down the Option key while choosing the item to delete from the menu. It will be deleted.
The Recent Search Dirs menu item stores all Search Dir’s added by the Other… button or by drag & dropping them onto File Safari’s icon in the Finder. This list is maintained until you Quit.
Other… button
Click this button to choose your Search Directory from a custom Get File dialog.
The Select xxxx button will select the current directory you are within, not the currently hilited folder or disk. Typing Command–S is equivalent to clicking the Select xxxx button so you can select directories from the keyboard when the Select xxxx button isn’t the default button.
Search Options button
This will bring up a dialog box with the following checkboxes:
• Ignore Case
Turn this on so the case of the Search String is ignored. Example: If the Search String is “lerxt” and Ignore Case is turned ON, then “LERXT”, “Lerxt”, and “lerxt” will all be found. If Ignore Case is turned OFF, only “lerxt” will be found.
• Ignore Diacriticals
Turn this on so any characters with a diacritical mark will be converted to the same char without the diacritical. Example: If the Search String is “Äbõtt” and Ignore Diacriticals is turned ON, then “Abott”, “Äbott”, and “Abõtt” will be found. If Ignore Case is turned OFF, only “Äbõtt” will be found. If both Ignore Case and Ignore Diacriticals are turned ON, then “abõtt” and “aBOTT” will also be found.
• 1st Occurrence Only
If you only want to see the 1st occurrence of a match in each file, turn this on. Otherwise all matches in each file will be shown in the results.
• Search Nested Folders
When this option is on, all folders within the Search Dir will be searched recursively. When it’s off, only the files immediately within the Search Dir will be searched.
• Whole Words
Turn this on to find only whole words. For example, when this is off, the Search String “Barn” will result in “Barney” being matched. When this is on, “Barney” will not be found.
• RAM Doubler is Evil Mode
If you use RAM Doubler on a PowerMac, it will slow File Safari’s search performance dramatically. Turn this option on to speed up searches if this applies to you.
• Data Fork
Turn this on to search the data fork of files. If you don’t know what that means, leave it turned on.
• Resource Fork
Turn this on to search the resource fork of files. If you don’t know what that means, turn it OFF.
• Detailed Resource Search
When this option is turned on, File Safari will search the resource fork resource–by–resource instead of as one big block. This enables you to see the type and ID of the resource containing the match, as well as the offset of the match within the resource. Using this option will slow the search down quite a bit. Also, you may notice that it shows less matches than the same search with it turned off. This is because the resource map at the end of the resource fork is searched when this option is off, but not when it is on. This option is only available when the Resource Fork option is on.
• Grep
This will allow you to enter regular expression or Grep patterns. Grep is very powerful, so I won’t go into any details. Here’s an example though. Turn on the Grep and Resource Fork options, set the File Types to ‘APPL’/‘****’, set the Search Dir to the File Safari folder, and enter “Mu[a-zA-Z]*ad” as the Search String. Hit Return and you should see my email address pop up.
File Types… button
This is where you can set which types of files File Safari will search. The dialog contains:
• Types and Creators lists
The buttons will act upon the hilited list. Hit Tab to switch beteen them. The up and down cursor keys will move the selection up and down in the active list.
• Add button
After typing a 4–character type or creator in the edit text field, this button will add that type or creator to which ever list is active. It will add the new item above the current hilited item.
• Remove button
Deletes the hilited item from the hilited list. Duh.
• Get Type/Creator… button
This button’s name will reflect the hilited list. Use it to locate any file and extract its type or creator.
Search Type popup menu
This menu controls how the search results are handled:
• New Search
This is the default. When you do a search, the search results field will be cleared prior to starting the search.
• Append Search to Results
When this type of search is used, subsequent searches will append their results onto the end of the existing search results instead of clearing it.
• Search Existing Results
This type of search will clear the results field, but saves file reference data of the results first. It then searches only the files listed in the saved data instead of the normal method of going through the Search Dir. This method is handy for narrowing down a search, e.g.; do New Search for “Andy”, then Search Existing Results for “Barney” will leave you with a list of Andy Griffith scripts in which Anj and Barn both appear in.
Search button
Click this to start the search. This will only be enabled if you have entered a Search String and chosen a Search Dir. Hitting the Return and Enter keys is the same as clicking on this button. After the searched has started, this button will change to Stop. The search can be stopped at any time by typing Escape, Command–. (Command–Period), Return, or Enter.
Hex Search button
Use this button to search for a hexadecimal string instead of an ASCII string. Hex strings can be entered in any of three ways:
C : 0x12EF or 0X12ef
Pascal: $12EF or $12ef
Normal: 12EF or 12ef
You can separate each byte—for example—by spaces if you prefer to make it easier to read:
6d 75 66 66 <—— Search String is “muff”
The Ignore Case option does apply to the resulting string. If Ignore Case is turned on and the previous hex string was searched for, “MUFF”, “Muff”, and “muff” would all be found. Same with Ignore Diacriticals.
Matches
This shows how many matches were found in how many files out of how many files searched.
The small area below the Matches area
This will show: The current file being searched during a search; The file’s full pathname when you click on a match in the results area; Other stuff.
The larger area below that
This is the search results area. All matches will be displayed here. Click on a match to fully see the file name. Click and hold to get the popup menu containing the file’s Type, Creator, and the offset and the line number at which the match was found, or the resource’s type, ID, and offset if Detailed Resource Search is turned on. Double–click to open the file. If you’re using any of the Metrowerks editors or BBEdit, File Safari also sends a goto–line Apple® Event to bring the line containing the match into view. If you’re using any other editor that supports a goto–line Æ, let me know and I’ll try to add it to the list.
Power users can Option–double–click a match to force their TEXT Editor to open the file, no matter what type the file is or which fork the match was found in.
Command–downArrow and Command–upArrow is the same as clicking the down and up arrows of the scrollbar. Add the Option key to move page–at–a–time.
The triangle
Use this to hide/show the search results info. You can also type Command–Tab to toggle the bottom half of the window.
For more info, read the file included in the archive named “Release Note.c”.
This file was edited with another program of mine that I’ll release some day. It can edit styled and colored text, ‘TEXT’ and ‘styl’ resources, and as a result of a tip I got about a publishing company looking for a small editor that could export RTF files, it can export RTF files.